import 'package:bruno/bruno.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:meal/constant/antd_icons.dart';
import 'package:meal/constant/sizes.dart';
import 'package:meal/utils/colors.dart';
import 'package:meal/utils/styles.dart';
import 'package:meal/utils/tools.dart';

///
/// 分类排序
///
class Sort extends StatefulWidget {
  const Sort({Key? key}) : super(key: key);

  @override
  State<Sort> createState() => _SortState();
}

class _SortState extends State<Sort> {

  Widget get actions {
    return BrnTextAction(
      '保存',
      iconPressed: () {
        Get.back();
      },
      themeData: BrnAppBarConfig(
          actionsStyle: BrnTextStyle(
              color: Colors.white, fontSize: Sizes.default16, fontWeight: FontWeight.normal)),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: ToolsUtils.getDefaultBackgroundColor(),
      appBar: ToolsUtils.getDefaultBrnAppBar('分类排序', actions: actions),
      body: SingleChildScrollView(
        child: Column(
          children: [
            Container(
              margin: const EdgeInsets.only(top: Sizes.default20),
              padding: const EdgeInsets.symmetric(horizontal: Sizes.default15),
              decoration: const BoxDecoration(color: Colors.white),
              child: ListBody(
                children: [
                  Container(
                    height: Sizes.default60,
                    alignment: Alignment.centerLeft,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text('石磨肠粉',
                            style: StylesUtils.customTextStyle(
                                fontSize: Sizes.default15, color: ColorsUtils.color333)),
                        Text.rich(TextSpan(
                            text: '置顶  ',
                            style: StylesUtils.customTextStyle(
                                fontSize: Sizes.default13, color: ColorsUtils.color006),
                            children: [
                              WidgetSpan(
                                  child: Icon(
                                    AntdIcons.menu,
                                    color:
                                        ColorsUtils.parseColorFromHexString(ColorsUtils.color999),
                                    size: Sizes.default15,
                                  ),
                                  alignment: PlaceholderAlignment.middle)
                            ]))
                      ],
                    ),
                  ),
                  Container(
                    height: Sizes.default60,
                    alignment: Alignment.centerLeft,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text('面食小吃',
                            style: StylesUtils.customTextStyle(
                                fontSize: Sizes.default15, color: ColorsUtils.color333)),
                        Text.rich(TextSpan(
                            text: '置顶  ',
                            style: StylesUtils.customTextStyle(
                                fontSize: Sizes.default13, color: ColorsUtils.color006),
                            children: [
                              WidgetSpan(
                                  child: Icon(
                                    AntdIcons.menu,
                                    color:
                                    ColorsUtils.parseColorFromHexString(ColorsUtils.color999),
                                    size: Sizes.default15,
                                  ),
                                  alignment: PlaceholderAlignment.middle)
                            ]))
                      ],
                    ),
                  ),
                  Container(
                    height: Sizes.default60,
                    alignment: Alignment.centerLeft,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text('粥食小吃',
                            style: StylesUtils.customTextStyle(
                                fontSize: Sizes.default15, color: ColorsUtils.color333)),
                        Text.rich(TextSpan(
                            text: '置顶  ',
                            style: StylesUtils.customTextStyle(
                                fontSize: Sizes.default13, color: ColorsUtils.color006),
                            children: [
                              WidgetSpan(
                                  child: Icon(
                                    AntdIcons.menu,
                                    color:
                                    ColorsUtils.parseColorFromHexString(ColorsUtils.color999),
                                    size: Sizes.default15,
                                  ),
                                  alignment: PlaceholderAlignment.middle)
                            ]))
                      ],
                    ),
                  ),
                ],
              ),
            )
          ],
        ),
      ),
    );
  }
}
